<template>
	<view class="content">
		<text class="text1" style="font-size: 50rpx;">子组件A</text>
		<view class="coma_box" style="margin-bottom: 20rpx;">
			<text>父组件传进来的值:</text>
			<text style="font-weight: bold; color: red;">{{ intent }}</text>
		</view>
		<button type="primary" @click="sendData()">传值给CompB组件</button>
	</view>
</template>

<script>
	export default {
		props: ['intent'],
		name: "compA",
		methods: {
			sendData() {
				console.warn("----CompA----sendData------>" + this.intent);
				uni.$emit('getIntent', this.intent); // 触发全局事件
			}
		}
	}
</script>
<style scoped>
.text1{
	margin-bottom: 10rpx;
	display: block;
	text-align: center;
}
</style>